﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TriggerFork : MonoBehaviour
{
    Transform oth = null;
    //DateTime closeTime;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.F) && oth != null)
        {
            oth.parent = null;
            oth = null;
        }
    }

    private void OnTriggerEnter(Collider other)
    {
        if(other.tag.Equals("MoveBox")&&oth==null)
        {
            other.transform.parent = transform;
            oth = other.transform;
        }
    }
}
